---
layout: page
title: 物灵的提问箱
permalink: /solu
---
<style>
	.jjz {
		width: 100%;
		background: transparent;
		color: inherit;
	}
	textarea {
		height: 6em;
		padding: 0.5em;
		margin: 1em 0;
	}
</style>
<script>
function 提交() {
        var xhr = new XMLHttpRequest();
        var toki = document.tokisin.toki.value;
        var jan = document.tokisin.jan.value;
        var uri = "https://api.物灵.fit/comment";
        var params = "pos=solu&toki=" + toki;
	if (jan.length)
		params = params + "&jan=" + jan;
        xhr.onreadystatechange = () => {
                if (xhr.readyState == 4) {
                        if (xhr.status == 200)
                                alert("发送成功，感谢您造访！");
                        else if (xhr.status == 500)
                                alert("系统忙，请稍后重试！");
                }
        };
        xhr.open('POST', uri, true);
        xhr.send(params);
}
</script>
<form name="tokisin">
	<label for="toki" style="display:none">提问</label>
	<textarea type="text" name="toki" placeholder="请在此处撰写您的问题" class="jjz"></textarea><br/>
	<label for="jan" style="display:none">联系方式</label>
	<input type="text" name="jan" class="jjz" placeholder="联系方式（可选）" />
	<small>信息将选登于本页。您的联系方式不会公开。</small><br/><a onclick="提交()" href="#">提交</a>
</form>

